package org.lgiavedoni.android.franq.interceptor.common.talk;

import org.lgiavedoni.android.franq.core.message.MessageIn;
import org.lgiavedoni.android.franq.core.message.MessageInterceptor;
import org.lgiavedoni.android.franq.core.position.Position;
import org.lgiavedoni.android.franq.core.speak.CommonPhraseHelper;
import org.lgiavedoni.android.franq.service.communication.CommunicationService;
import org.lgiavedoni.android.franq.service.phone.location.LocationService;
import org.lgiavedoni.android.franq.util.googe.MapsUtil;

public class WhereAreYouMessageInterceptor extends MessageInterceptor {

	@Override
	public void processMessage(MessageIn message) throws Exception {
		Position position = LocationService.inst.getLocation();
		if (position != null)
			CommunicationService.inst.sendDefaultTextMessage("I am here: " + MapsUtil.getURL(position));
		else
			CommunicationService.inst.sendMessage(CommonPhraseHelper.IDONT_KNOW);
	}

	@Override
	public String[] getInterceptorTags() {
		return new String[] { "where", "are", "you" };
	}

}
